﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Obra.SmugMug.Api;
using System.ServiceModel;

namespace Obra.PowerShell.SmugMug
{
    internal class DriveInfo :
        PSDriveInfo
    {
        private readonly ISmugMugClientService smugMugClient;

        /// <summary>
        /// c-tor
        /// </summary>
        public DriveInfo(
            PSDriveInfo psDriveInfo,
            DynamicParameters newDriveParameters)
            : base(psDriveInfo)
        {
            string uriString = String.IsNullOrEmpty(newDriveParameters.Uri) ?
                Strings.DefaultEndpoint :
                newDriveParameters.Uri;

            this.smugMugClient = new SmugMugClientServiceProvider(
                psDriveInfo.Credential,
                new EndpointAddress(uriString));
        }

        /// <summary>
        /// 
        /// </summary>
        public ISmugMugClientService SmugMugClient
        {
            get { return this.smugMugClient; }
        }

        public IPathMappingService PathMappingService
        {
            get;
            set;
        }
    }
}
